package com.etocrm.saas.lib.base.common.enums.member;


import com.etocrm.saas.lib.base.common.enums.base.BaseEnum;

import java.util.Objects;

/**
 * 会员 注册来源枚举
 */
public enum RegisteredChannelEnum implements BaseEnum {
    WX(2, "微信"),
    WX_APP(3, "微信小程序"),
    SHOPPING_GUIDE(4, "导购通"),
    T_MALL(5, "天猫"),
    STORE(6, "门店"),
    IMPORT_REGISTRATION(11, "导入 + 注册"),
    IMPORT_WX(12, "导入 + 微信"),
    IMPORT_WX_APP(13, "导入 + 小程序"),
    IMPORT_SHOPPING_GUIDE(14, "导入 + 导购通"),
    IMPORT_T_MALL(15, "导入 + 天猫"),
    IMPORT_STORE(16, "导入 + 门店"),
    ;

    private Integer value;
    private String desc;

    RegisteredChannelEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }


    //通过value获取枚举
    public static RegisteredChannelEnum getByValue(Integer value) {
        if (value == null) {
            return null;
        }
        for (RegisteredChannelEnum v : values()) {
            if (Objects.equals(v.value, value)) {
                return v;
            }
        }
        return null;
    }


    @Override
    public Integer getValue() {
        return this.value;
    }

    @Override
    public String getDesc() {
        return this.desc;
    }

    @Override
    public String toString() {
        return this.desc;
    }
}
